﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Royaumes_Libres.Database;

namespace Royaumes_Libres
{
    /// <summary>
    /// Affiche les buildings qui existe dans le royaume.
    /// </summary>
    /// <remarks>Patrick Chabot</remarks>
    public partial class ucOwnerBuilding : System.Web.UI.UserControl
    {
        protected cOwnerBuildings pBuilding;
        public cOwnerBuildings Building { set { this.pBuilding = value; } }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.InitControl();
        }

        public void InitControl()
        {
            this.imgBuilding.ImageUrl = this.pBuilding.ImgUrl;
            this.lblName.Text = cText.GetText(this.pBuilding.Name);
            this.lblText.Text = cText.GetText("Bonus" + this.pBuilding.Name);
            this.lblQuantity.Text = this.pBuilding.Quantity.ToString();
            if (this.pBuilding.UniqueBuild)
            {
                this.quantity.Visible = false;
                this.text.CssClass = "largeText";
            }
        }
    }
}